package main

import (
	"os"
	"syscall"
)

type PathError struct  {
	Op string
	Path string
	Err error
}

func (err *PathError) Error() string  {
	return err.Op +" , " + err.Path +" , "+ err.Err.Error()
}

func Stat(name string)(fi os.FileInfo ,err error)  {
	var stat syscall.Stat_t
	err = syscall.Stat(name,&stat)
	if err != nil {
		return nil,&PathError{"Stat",name,err}
	}
	return nil,nil
}

func main() {
	var fi,err = Stat("/var/sdf")
	if err != nil {
		println("err ",err.Error(),fi)
	}
}
